<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <input type="text" placeholder="请输入内容" id="textInput" />
  <input type="submit" value="提交" id="submit">
  <p id="reTime"></p>
  <script>
    const { ipcRenderer } = require("electron");
    const val = document.getElementById('textInput'), submit = document.getElementById('submit'), reTime = document.getElementById('reTime')
    submit.addEventListener('click', (e) => {
      e.preventDefault()
      console.log(val.value);
      if (val.value) {
        ipcRenderer.send('addtext', val.value)
      }
    })
    ipcRenderer.on('subRemoveTime', (event, val) => {
      console.log(val, '撤回');
      reTime.innerHTML = val
    })
  </script>
</body>

</html>
